Matthias Clasen [Mon, 14 Sep 2015 15:15:32 +0000 (11:15 -0400)]
Revert "tool button: Use G_DEFINE_TYPE"
This reverts commit
4e56dfad0e33187d019c44ecfb5e7e99cf2da535.
It turns out that GtkToolButton is playing games with the class
pointer inside instance_init, so leave it alone.
Matthias Clasen [Mon, 14 Sep 2015 13:38:08 +0000 (09:38 -0400)]
gtk-builder-tool: Don't break GtkHBox and GtkVBox
These classes have different defaults for ::expand than GtkBox,
which is not reflected in the declared default, so we have to
blacklist it.
Matthias Clasen [Mon, 14 Sep 2015 13:35:01 +0000 (09:35 -0400)]
gtk-demo: Fix builder example
This example is still using a GtkVBox, and it happened to be broken
by gtk-builder-tool simplify.
Fran Dieguez [Mon, 14 Sep 2015 14:47:51 +0000 (16:47 +0200)]
Updated Galician translations
Fran Dieguez [Mon, 14 Sep 2015 14:44:48 +0000 (16:44 +0200)]
Updated Galician translations
Alexander Larsson [Mon, 14 Sep 2015 13:05:37 +0000 (15:05 +0200)]
widget: Call size_allocate vfunc directly when possible
This avoids all the overhead of signal emissions when it is not used.
Alexander Larsson [Mon, 14 Sep 2015 09:36:43 +0000 (11:36 +0200)]
draw: call vfunc rather then emit signal for the common case
This avoids a lot of overhead in the common case where a signal
is not connected and we're just using the class vfunc (which is true
for all in-libgtk widgets). Additionally it makes backtraces in
debuggers and profiles much much nicer to look at.
https://bugzilla.gnome.org/show_bug.cgi?id=754986
Alexander Larsson [Mon, 14 Sep 2015 08:56:13 +0000 (10:56 +0200)]
gtk: Stop setting GDK_EXPOSURE_MASK on random widgets
These days exposure happens only on the native windows (generally the
toplevel window) and is propagated down recursively. The expose event
is only useful for backwards compat, and in fact, for double buffered
widgets we totally ignore the event (and non-double buffering breaks
on wayland).
So, by not setting the mask we avoid emitting these events and then
later ignoring them.
We still keep it on eventbox, fixed and layout as these are used
in weird ways that want backwards compat.
Alexander Larsson [Mon, 14 Sep 2015 07:43:14 +0000 (09:43 +0200)]
gdkwindow: Avoid list allocation and object refs during repaint
There is no need to ref the windows we're ignoring, so collect and ref
only the affected child windows. Also, use a on-stack array rather
than allocating a linked list.
Also, we don't need to ref during the event emissions too, as we
already hold a ref.
https://bugzilla.gnome.org/show_bug.cgi?id=754687
Pedro Albuquerque [Mon, 14 Sep 2015 07:31:34 +0000 (07:31 +0000)]
Updated Portuguese translation
Piotr Drąg [Mon, 14 Sep 2015 07:30:30 +0000 (09:30 +0200)]
Updated Polish translation
Matthias Clasen [Mon, 14 Sep 2015 03:26:16 +0000 (23:26 -0400)]
Update all ui files again
Replace translatable="1" by translatable="yes" so
xgettext stays happy and extracts the strings.
Matthias Clasen [Mon, 14 Sep 2015 03:24:05 +0000 (23:24 -0400)]
builder-tool: Don't simplify translatable="yes"
It turns out that xgettext does not understand translatable="1",
so don't make gtk-builder-tool produce this, even though
GtkBuilder can parse it just fine.
https://bugzilla.gnome.org/show_bug.cgi?id=754928
Matthias Clasen [Fri, 4 Sep 2015 22:26:51 +0000 (18:26 -0400)]
file chooser: make rows with popovers visible
Without this, the popovers are just dangling in the middle of
nowhere.
https://bugzilla.gnome.org/show_bug.cgi?id=754411
Christian Hergert [Sun, 13 Sep 2015 20:40:57 +0000 (13:40 -0700)]
pixelcache: squash warnings introduced by previous commits
Christian Hergert [Tue, 8 Sep 2015 22:36:07 +0000 (15:36 -0700)]
textview: give pixelcache access to style context
This changes textview to share the style context with the pixelcache.
Doing so allows pixel cache to optimize the surface creation and use
a CAIRO_CONTENT_COLOR instead of CAIRO_CONTENT_COLOR_ALPHA when
appropriate.
https://bugzilla.gnome.org/show_bug.cgi?id=754658
Christian Hergert [Tue, 8 Sep 2015 22:09:04 +0000 (15:09 -0700)]
viewport: share style context with pixelcache
This allows the pixel cache to opportunistically use CAIRO_CONTENT_COLOR
instead of CAIRO_CONTENT_COLOR_ALPHA during surface creation.
https://bugzilla.gnome.org/show_bug.cgi?id=754658
Christian Hergert [Tue, 8 Sep 2015 21:48:40 +0000 (14:48 -0700)]
pixelcache: use GtkStyleContext to determine cairo_content_t for surface
We can take a fast path if the background for a widget is opaque by using
a CAIRO_CONTENT_COLOR instead of a CAIRO_CONTENT_COLOR_ALPHA surface. Most
blit'ing backends have a fast path for this, including Pixman and Quartz.
https://bugzilla.gnome.org/show_bug.cgi?id=754658
Christian Hergert [Tue, 8 Sep 2015 21:45:51 +0000 (14:45 -0700)]
stylecontext: add opaque background helper
This new private API, _gtk_style_context_is_background_opaque(), is meant to
be used by internal Gtk+ wigets to optimize fast paths for cases where
applicable. One such use would be to use a CAIRO_CONTENT_COLOR surface
instead of CAIRO_CONTENT_COLOR_ALPHA.
https://bugzilla.gnome.org/show_bug.cgi?id=754658
Matthias Clasen [Sun, 13 Sep 2015 18:18:19 +0000 (14:18 -0400)]
wayland: Avoid a crash with GtkGLArea
We must not call gdk_wayland_window_attach_image when
using GL for drawing, this leads to a crash.
https://bugzilla.gnome.org/show_bug.cgi?id=754770
Alexander Larsson [Thu, 10 Sep 2015 10:57:16 +0000 (12:57 +0200)]
gdkwindow: Store children list nodes in GdkWindow structure
This avoids a bunch of allocations, and additionally it has better
cache behaviour, as we don't follow pointers to the separate GList
node memory areas during traversal.
From Christian Hergert:
This machine is a Retina mac book pro so I've been working on getting
GtkTextView (GtkPixelCache) up to our performance level on
X11/Wayland. I'm seeing a jump from about 43 FPS to about 50 FPS.
https://bugzilla.gnome.org/show_bug.cgi?id=754687
Matthias Clasen [Sun, 13 Sep 2015 16:44:17 +0000 (12:44 -0400)]
places sidebar: keep open variants sensitive
Add a separate action for "Open in Tab" and "Open in new window"
so we can keep them enabled when we disable "Open" for the selected
row.
https://bugzilla.gnome.org/show_bug.cgi?id=754410
Dušan Kazik [Sun, 13 Sep 2015 08:58:00 +0000 (08:58 +0000)]
Updated Slovak translation
Dušan Kazik [Sun, 13 Sep 2015 08:50:28 +0000 (08:50 +0000)]
Updated Slovak translation
Matthias Clasen [Sun, 13 Sep 2015 03:56:39 +0000 (23:56 -0400)]
Drop GtkWidgetAuxInfo
Merge it into GtkWidgetPrivate. In my measurements, about half
of all widgets have a non-default auxinfo struct, and we use this
information in size allocation, so it is nice to avoid the gdata
overhead.
Matthias Clasen [Sun, 13 Sep 2015 00:58:41 +0000 (20:58 -0400)]
Move font map to qdata
This is very rarely used, lets not reserve space for it
in every widget.
Matthias Clasen [Sun, 13 Sep 2015 00:41:45 +0000 (20:41 -0400)]
Move font options to gdata
This is very rarely used, lets not reserve space for it in
every widget.
Matthias Clasen [Sun, 13 Sep 2015 00:08:56 +0000 (20:08 -0400)]
Move action muxer to gdata
Most widgets don't have their own, and we don't access them
very frequently.
Matthias Clasen [Sat, 12 Sep 2015 23:50:42 +0000 (19:50 -0400)]
Move widget paths to gdata
We only use widget paths for a few widgets nowadays (notebook,
treeview, pathbar, combobox), so we can save some space by
not having this field in GtkWidgetPrivate.
Benjamin Otte [Sat, 12 Sep 2015 23:52:49 +0000 (01:52 +0200)]
combobox: Stop using old styling code
Instead of get_path_for_child() use CSS nodes.
Matthias Clasen [Sat, 12 Sep 2015 23:22:17 +0000 (19:22 -0400)]
Move template support to qdata
The hash table is only accessed at creation and destruction time,
and many widgets don't use templates at all, so no need to have
this permanently occupying space.
Matthias Clasen [Sat, 12 Sep 2015 22:54:38 +0000 (18:54 -0400)]
Pack GtkWidgetPrivate a bit better
This makes it shrink from 240 to 232 bytes.
Matthias Clasen [Sat, 12 Sep 2015 22:48:17 +0000 (18:48 -0400)]
Use NULL instead of g_direct_equal
GHashTable has built-in support for pointer comparison.
Matthias Clasen [Sat, 12 Sep 2015 22:36:32 +0000 (18:36 -0400)]
Move GtkWidgetAuxInfo struct to private headers
There's no API returning such a struct, it is entirely internal.
Therefore, don't expose it in public headers.
Benjamin Otte [Sat, 12 Sep 2015 19:27:10 +0000 (21:27 +0200)]
Revert "Avoid type checking overhead for resize-mode"
This reverts commit
3eacfa88f2d9c690a006de9cac1cd3c60901686c.
Apart from the patch not being correct, we don't want to expose private
structures in header files if we can avoid it.
And this type-checking overhead is not an optimization that is even
measurable.
https://bugzilla.gnome.org/show_bug.cgi?id=754932
Piotr Drąg [Sat, 12 Sep 2015 17:42:41 +0000 (19:42 +0200)]
Updated POTFILES.in
Matthias Clasen [Sat, 12 Sep 2015 13:14:47 +0000 (09:14 -0400)]
Use g_object_get_qdata instead of g_object_get_data
This is less expensive.
Matthias Clasen [Sat, 12 Sep 2015 13:13:00 +0000 (09:13 -0400)]
Intern all signal names beforehand
This avoids pointless allocations
Matthias Clasen [Fri, 11 Sep 2015 23:05:49 +0000 (19:05 -0400)]
css node: Avoid a duplicate type check
Matthias Clasen [Fri, 11 Sep 2015 23:05:19 +0000 (19:05 -0400)]
widget path: No need for atomic refcounting
We are all in one thread, anyway.
Matthias Clasen [Fri, 11 Sep 2015 23:04:54 +0000 (19:04 -0400)]
css value: No need for atomic refcounting
We are all in one thread anyway.
Matthias Clasen [Fri, 11 Sep 2015 23:04:07 +0000 (19:04 -0400)]
css section: No need for atomic refcounting
We are all in one thread, anyway.
Matthias Clasen [Fri, 11 Sep 2015 21:12:35 +0000 (17:12 -0400)]
Avoid type checking overhead for resize-mode
Matthias Clasen [Fri, 11 Sep 2015 13:09:10 +0000 (09:09 -0400)]
window: Avoid unnecessary detours
Don't call gtk_widget_get_screen on a window - it only ends up
calling gtk_window_get_screen in the end, anyway.
Matthias Clasen [Fri, 11 Sep 2015 13:08:36 +0000 (09:08 -0400)]
Remove type check from gtk_widget_get_request_mode
Matthias Clasen [Fri, 11 Sep 2015 13:07:37 +0000 (09:07 -0400)]
widget: Move _gtk_widget_peek_request_cache to private.h
Matthias Clasen [Fri, 11 Sep 2015 02:04:31 +0000 (22:04 -0400)]
css node declaration: Avoid optional out parameters
Always pass a pos to find_class, and avoid the if.
Matthias Clasen [Fri, 11 Sep 2015 00:43:21 +0000 (20:43 -0400)]
css node declaration: Fix a typo
Matthias Clasen [Fri, 11 Sep 2015 22:48:20 +0000 (18:48 -0400)]
css section: Replace g_return by gtk_internal_return
Matthias Clasen [Fri, 11 Sep 2015 20:30:07 +0000 (16:30 -0400)]
style cascade: Replace g_return by gtk_internal_return
Matthias Clasen [Fri, 11 Sep 2015 02:02:03 +0000 (22:02 -0400)]
css lookup: Replace g_return by gtk_internal return
These functions are called in an inner loop in
gtk_css_style_provider_lookup.
Matthias Clasen [Fri, 11 Sep 2015 00:42:58 +0000 (20:42 -0400)]
css selector: Use a builtin to count bits
Matthias Clasen [Fri, 11 Sep 2015 00:42:07 +0000 (20:42 -0400)]
css matcher: Avoid a redundant call
The sole caller passes an interned string, so we don't
need to call g_intern_string again.
Matthias Clasen [Fri, 11 Sep 2015 00:04:24 +0000 (20:04 -0400)]
css selector: Take advantage of interned strings
We know these strings are interned, no need to use strcmp or
g_str_hash for hem.
Matthias Clasen [Fri, 11 Sep 2015 13:06:46 +0000 (09:06 -0400)]
bitmask: Trivial formatting fix
Matthias Clasen [Thu, 10 Sep 2015 22:48:29 +0000 (18:48 -0400)]
bitmask: Optimize no-op resizes
Statistics for the gtk3-demo listbox example show that the
vast majority of calls to _gtk_allocated_bitmask_resize go
from a size of 2 to 2. Don't needlessly call realloc() in
this case.
Matthias Clasen [Thu, 10 Sep 2015 22:46:58 +0000 (18:46 -0400)]
bitmask: Optimize intersect
The functions was written in a way that would possibly
resize the mask twice, which is not necessary.
Matthias Clasen [Wed, 9 Sep 2015 21:32:47 +0000 (17:32 -0400)]
widget-factory: Simplify the ui file
Matthias Clasen [Wed, 9 Sep 2015 21:34:32 +0000 (17:34 -0400)]
gtk-demo: Simplify ui files
Matthias Clasen [Wed, 9 Sep 2015 20:50:49 +0000 (16:50 -0400)]
Run gtk-builder-tool simplify over all templates
Matthias Clasen [Wed, 9 Sep 2015 20:47:02 +0000 (16:47 -0400)]
gtk-builder-tool: Canonicalize booleans
Always write booleans as '0' or '1'.
Matthias Clasen [Wed, 9 Sep 2015 20:52:11 +0000 (16:52 -0400)]
builder: Minor tweak
Benjamin Otte [Sat, 12 Sep 2015 00:59:38 +0000 (02:59 +0200)]
widgetpath: Implement using GtkCssNodeDeclaration
This removes a bunch of code but more importantly allows providing the
declaration in CSS matchers.
Benjamin Otte [Sat, 12 Sep 2015 00:58:28 +0000 (02:58 +0200)]
cssnode: Move clear_classes() into the NodeDeclaration
The previous code was crashing when used as the returned classes array
would have been invalid after the first deletion. So if a 2nd class
would be deleted, invalid memory might have been referenced.
Garrett Regier [Fri, 11 Sep 2015 16:46:34 +0000 (09:46 -0700)]
stylecontext: Fix list_classes() after optimization
Otherwise a junk value is returned.
Garrett Regier [Fri, 11 Sep 2015 16:45:32 +0000 (09:45 -0700)]
widgetpath: Remove bad function prototypes
Benjamin Otte [Fri, 11 Sep 2015 16:33:05 +0000 (18:33 +0200)]
iconcache: Guard deprecated gdk-pixbuf APIs
Garrett Regier [Fri, 11 Sep 2015 15:49:59 +0000 (17:49 +0200)]
cssnode: Optimize listing of classes
Avoid creating the GList of strings when the GQuarks
will just be determined again. Instead have
gtk_style_context_list_classes() do it specifically.
Garrett Regier [Fri, 11 Sep 2015 14:13:45 +0000 (16:13 +0200)]
container: Don't add classes twice
_gtk_widget_create_path() already adds the style classes.
Alberts Muktupāvels [Fri, 11 Sep 2015 09:49:51 +0000 (12:49 +0300)]
gtkplug.c: remove draw function, not needed
Background will be rendered by parent class - GtkWindow.
https://bugzilla.gnome.org/show_bug.cgi?id=754854
Michael Weghorn [Thu, 13 Aug 2015 20:31:28 +0000 (22:31 +0200)]
Improve printer distinction for option retrieval
In order to retrieve the user options for a printer, the respective
printer name is used.
This fixes the comparison of printer names to avoid that the options of
another printer are accidently read whose name starts with the same
letters, but is longer (e.g. "myprinterlongername" instead of
"myprinter").
This fixes Bug 753628.
Jakub Steiner [Fri, 11 Sep 2015 10:39:08 +0000 (12:39 +0200)]
HighContrast: make sidebar list rows taller
sync with Adwaita
https://bugzilla.gnome.org/show_bug.cgi?id=754866
Ross Lagerwall [Tue, 8 Sep 2015 22:12:54 +0000 (23:12 +0100)]
GtkFileSystem: Add to the list of remote filesystems
Add afp and google-drive to the list of remote filesystems.
https://bugzilla.gnome.org/show_bug.cgi?id=754746
Dušan Kazik [Thu, 10 Sep 2015 16:26:56 +0000 (16:26 +0000)]
Updated Slovak translation
Timm Bäder [Thu, 10 Sep 2015 09:47:34 +0000 (11:47 +0200)]
GtkWidget: Fix typo in #ifdef
It's ENABLE, not ENABEL. Also fix the corresponding #endif comments.
Timm Bäder [Thu, 10 Sep 2015 09:34:44 +0000 (11:34 +0200)]
GtkContainer: Fix paramter name in doc comment
Matthias Clasen [Wed, 9 Sep 2015 18:40:36 +0000 (14:40 -0400)]
Optimize gtk_css_node_declaration_has_class
This function is getting called a lot. Statistics for the gtk3-demo
listbox example show most calls with 0-4 classes. Unrolling the cases
a bit brings the instruction count in callgrind from 93M to 52M.
Matthias Clasen [Wed, 9 Sep 2015 18:09:21 +0000 (14:09 -0400)]
More bit manipulation speedups
The same trick that was applied to _gtk_css_change_for_child in
the previous commit can be applied to _gtk_css_change_for_sibling
as well, and that is what this commit does.
With both functions converted, gtk_css_change_translate is no
longer needed and gets dropped.
Matthias Clasen [Wed, 9 Sep 2015 18:00:49 +0000 (14:00 -0400)]
Manipulate bits more efficiently
The function to translate GtkCssChange enum values to the PARENT
ones is called very frequently. This patch speeds it up tremendously.
The callgrind instruction count for this function in the listbox
demo goes from 108M to 7M.
Matthias Clasen [Wed, 9 Sep 2015 15:08:43 +0000 (11:08 -0400)]
match_all: Only allocate an array when needed
My statistics show that more than half of all calls end up
with 0 matches, so we can avoid some overhead by not allocating
an array at all in this case.
Matthias Clasen [Wed, 9 Sep 2015 14:55:31 +0000 (10:55 -0400)]
Handle match_all returning NULL
This is in preparation for not allocating an array at all if there
are no matches.
Matthias Clasen [Wed, 9 Sep 2015 14:46:48 +0000 (10:46 -0400)]
Optimize gtk_css_selector_match_all
We are dealing with really short lists here.
95% are < 10 matches, and the longest I've been able to record was 19.
So just do away with the hash table and do sorted insertion in
the array directly.
Carlos Garnacho [Wed, 9 Sep 2015 14:05:15 +0000 (16:05 +0200)]
x11: Declare variable for the inner loop
Otherwise the outer loop control variable is messed up, and we end
up with uninitialized axes if there were any more valuators after
the XIKeyClass one.
This bug was sneakily introduced by
fdb9a8e14, many thanks to
Carlos Soriano for helping spot the source of this bug.
https://bugzilla.gnome.org/show_bug.cgi?id=753431
Lapo Calamandrei [Tue, 8 Sep 2015 18:10:51 +0000 (20:10 +0200)]
Adwaita: special case selection mode lists checks
...otherwise the special selection mode 40x40px checks are used
shrinked to 16x16.
See https://bugzilla.gnome.org/show_bug.cgi?id=754610
Matthias Clasen [Wed, 9 Sep 2015 14:20:07 +0000 (10:20 -0400)]
Update the gtk3-demo man page
We have options now !
Matthias Clasen [Wed, 9 Sep 2015 14:14:17 +0000 (10:14 -0400)]
gtk-demo:Add a --list option
This just shows the available examples and then exists.
Matthias Clasen [Wed, 9 Sep 2015 12:07:20 +0000 (08:07 -0400)]
gtk-demo: Make --autoquit a simple option
No real need to specify the amount of delay, just make this
a plain boolean.
Matthias Clasen [Wed, 9 Sep 2015 04:51:45 +0000 (00:51 -0400)]
Use G_ENABLE_CONSISTENCY_CHECKS for template finalization checks
Matthias Clasen [Wed, 9 Sep 2015 04:38:48 +0000 (00:38 -0400)]
css selector: Use the quarks we have
Unless I'm missing something, there is no reason to go from
quarks back to strings to implement hasing or comparison.
Matthias Clasen [Wed, 9 Sep 2015 03:21:17 +0000 (23:21 -0400)]
style provider private: Use gtk_internal_return_if_fail
Matthias Clasen [Wed, 9 Sep 2015 02:48:44 +0000 (22:48 -0400)]
Clean up debug features
Introduce a GTK_DEBUG_CHECK() macro and use it to check for
GTK_DEBUG flags everywhere. Also guard all such places by
Matthias Clasen [Wed, 9 Sep 2015 01:08:20 +0000 (21:08 -0400)]
widget: Use G_ENABLE_CONSISTENCY_CHECKS for invariants checking
The logic here is that G_ENABLE_DEBUG is for compiling out
debug spew that can be triggered at runtime with the GTK_DEBUG
environment variable, while G_ENABLE_CONSISTENCY_CHECKS is for
consistency checks that are applied unconditionally.
Matthias Clasen [Wed, 9 Sep 2015 01:06:38 +0000 (21:06 -0400)]
size request: Redo the recursion checks
Use G_ENABLE_CONSISTENCY checks for the recursion checks
in gtksizerequest.c
Matthias Clasen [Wed, 9 Sep 2015 01:20:00 +0000 (21:20 -0400)]
Introduce G_ENABLE_CONSISTENCY_CHECKS
Use a separate G_ENABLE_CONSISTENCY_CHECKS define to guard internal
consistency checks that are applied unconditionally if they are enabled,
such as the widget invariants checking. Interactive debug spew that can
be triggered at runtime with the GTK_DEBUG environment variable is still
guarded by the G_ENABLE_DEBUG define.
The mapping from enable-debug levels to defines is as follows:
yes: G_ENABLE_DEBUG G_ENABLE_CONSISTENCY_CHECKS
minimum: G_ENABLE_DEBUG G_DISABLE_CAST_CHECKS
no: G_DISABLE_CAST_CHECKS G_DISABLE_ASSERT G_DISABLE_CHECKS
Matthias Clasen [Wed, 9 Sep 2015 00:55:32 +0000 (20:55 -0400)]
notebook: Drop use of G_DISABLE_CHECKS
Rewrite the one check that the G_DISABLE_CHECKS macro was used for
in terms of g_return_if_fail.
Matthias Clasen [Wed, 9 Sep 2015 00:39:52 +0000 (20:39 -0400)]
Drop an unused warning
It has been ifzeroed for many, many years.
Matthias Clasen [Wed, 9 Sep 2015 00:30:22 +0000 (20:30 -0400)]
Use a getter for widget direction
Matthias Clasen [Wed, 9 Sep 2015 00:27:50 +0000 (20:27 -0400)]
settings: Reuse a value
We've already gotten the value type, use it.
Matthias Clasen [Wed, 9 Sep 2015 00:24:29 +0000 (20:24 -0400)]
builder: Avoid some type-checking overhead
Matthias Clasen [Tue, 8 Sep 2015 23:29:32 +0000 (19:29 -0400)]
settings: Avoid a redundant check
g_value_transform already returns whether it was successful
or not, so no need to call g_value_type_transformable beforehand.